<template>
  <div>
    <div
        :style='{"width":"100%","padding":"0px 7%","margin":"0px auto 10px","borderRadius":"0px","background":"#99cc99","height":"40px"}'
        class="breadcrumb-preview">
      <el-breadcrumb :separator="'Ξ'" :style='{"fontSize":"14px","lineHeight":"40px"}'>
        <el-breadcrumb-item>首页</el-breadcrumb-item>
        <el-breadcrumb-item v-for="(item, index) in breadcrumbItem" :key="index">{{ item.name }}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>

    <div class="list-preview"
         :style='{"width":"100%","padding":"10px 0","margin":"0px auto","position":"relative","background":"none"}'>


      <el-form :inline="true" :model="formSearch" class="list-form-pv"
               :style='{"padding":"30px 7% 0","alignItems":"center","background":"none","display":"flex","width":"100%","justifyContent":"center","height":"auto"}'>
        <el-form-item :style='{"margin":"0 4px 0 0","justifyContent":"center","display":"flex"}'>
          <div class="lable" v-if="true"
               :style='{"width":"auto","padding":"0 10px","lineHeight":"42px","fontSize":"16px","display":"inline-block"}'>
            用户名
          </div>
          <el-input v-model="formSearch.nickname" placeholder="用户名" clearable></el-input>
        </el-form-item>
        <el-form-item :style='{"margin":"0 4px 0 0","justifyContent":"center","display":"flex"}'>
          <div class="lable" v-if="true"
               :style='{"width":"auto","padding":"0 10px","lineHeight":"42px","fontSize":"16px","display":"inline-block"}'>
            评论内容
          </div>
          <el-input v-model="formSearch.content" placeholder="评论内容" clearable></el-input>
        </el-form-item>
        <el-button v-if=" true "
                   :style='{"cursor":"pointer","border":"0","padding":"0px 15px","margin":"0 10px 0 0","outline":"none","color":"#fff","borderRadius":"4px","background":"#ff9966","width":"auto","fontSize":"16px","lineHeight":"42px","height":"42px"}'
                   type="primary" @click="getList(1, curFenlei)"><i v-if="true"
                                                                    :style='{"color":"#fff","margin":"0 10px 0 0","fontSize":"16px"}'
                                                                    class="el-icon-search"></i>查询
        </el-button>
        <el-button v-if="isAuth('discussbisaijieguo','新增')"
                   :style='{"cursor":"pointer","border":"0","padding":"0px 15px","margin":"0 10px 0 0","outline":"none","color":"#fff","borderRadius":"4px","background":"#1e8892","width":"auto","fontSize":"16px","lineHeight":"42px","height":"42px"}'
                   type="primary" @click="add('/index/discussbisaijieguoAdd')"><i v-if="true"
                                                                                  :style='{"color":"#fff","margin":"0 10px 0 0","fontSize":"16px"}'
                                                                                  class="el-icon-circle-plus-outline"></i>添加
        </el-button>
      </el-form>

      <div class="list"
           :style='{"padding":"120px 7% 100px","margin":"20px 0 10px","background":"url(http://codegen.caihongy.cn/20230109/138a4d606eae4a168810cef229969885.png) no-repeat center top,url(http://codegen.caihongy.cn/20230109/b95aeae1c1294f398aefb7c6cd5b16de.png) no-repeat center top,url(http://codegen.caihongy.cn/20230109/5ffc803e6682418eb7f0b09a98e35527.png) no-repeat center bottom,#99CC99"}'>
        <!-- 样式一 -->
        <div class="list1 index-pv1"
             :style='{"padding":"0px","margin":"30px 0 0","flexWrap":"wrap","background":"none","display":"flex","width":"100%","justifyContent":"space-between","height":"auto"}'>
          <div
              :style='{"border":"1px solid #ddd","padding":"10px","margin":"0 0 20px","flexWrap":"wrap","background":"#fff","display":"flex","width":"23.5%","position":"relative","justifyContent":"space-between","height":"auto"}'
              v-for="(item, index) in dataList" :key="index" @click="toDetail(item)" class="list-item animation-box">
            <div v-if="item.price"
                 :style='{"width":"100%","padding":"4px 10px","lineHeight":"24px","fontSize":"14px","color":"red","textAlign":"right"}'
                 class="price"><span :style='{"fontSize":"12px"}'>￥</span>{{ item.price }}
            </div>
          </div>
        </div>

        <!-- 样式二 -->
      </div>


      <el-pagination
          background
          class="pagination"
          :pager-count="7"
          :page-size="pageSize"
          :page-sizes="pageSizes"
          prev-text="<"
          next-text=">"
          :hide-on-single-page="true"
          :layout='["total","prev","pager","next","sizes","jumper"].join()'
          :total="total"
          :style='{"padding":"0","margin":"10px auto","whiteSpace":"nowrap","color":"#333","textAlign":"center","width":"100%","fontWeight":"500"}'
          @current-change="curChange"
          @size-change="sizeChange"
          @prev-click="prevClick"
          @next-click="nextClick"
      ></el-pagination>

    </div>
  </div>
</template>

<script>
export default {
  //数据集合
  data() {
    return {
      layouts: '',
      swiperIndex: -1,
      baseUrl: '',
      breadcrumbItem: [
        {
          name: '比赛结果评论表'
        }
      ],
      formSearch: {
        nickname: '',
        content: '',
      },
      fenlei: [],
      dataList: [],
      total: 1,
      pageSize: 12,
      pageSizes: [10, 20, 30, 50],
      totalPage: 1,
      curFenlei: '全部',
      isPlain: false,
      indexQueryCondition: '',
      timeRange: []
    }
  },
  created() {
    this.indexQueryCondition = this.$route.query.indexQueryCondition ? this.$route.query.indexQueryCondition : '';
    this.baseUrl = this.$config.baseUrl;
    this.getFenlei();
    this.getList(1, '全部');
  },
  //方法集合
  methods: {
    add(path) {
      this.$router.push({path: path});
    },
    getFenlei() {
    },
    getList(page, fenlei, ref = '') {
      let params = {page, limit: this.pageSize};
      let searchWhere = {};
      if (this.formSearch.nickname != '') searchWhere.nickname = '%' + this.formSearch.nickname + '%';
      if (this.formSearch.content != '') searchWhere.content = '%' + this.formSearch.content + '%';
      this.$http.get('discussbisaijieguo/list', {params: Object.assign(params, searchWhere)}).then(res => {
        if (res.data.code == 0) {
          this.dataList = res.data.data.list;
          this.total = res.data.data.total;
          this.pageSize = res.data.data.pageSize;
          this.totalPage = res.data.data.totalPage;

          this.pageSizes = [this.pageSize, this.pageSize * 2, this.pageSize * 3, this.pageSize * 5];
        }
      });
    },
    curChange(page) {
      this.getList(page);
    },
    prevClick(page) {
      this.getList(page);
    },
    sizeChange(size) {
      this.pageSize = size
      this.getList(1);
    },
    nextClick(page) {
      this.getList(page);
    },
    toDetail(item) {
      this.$router.push({path: '/index/discussbisaijieguoDetail', query: {detailObj: JSON.stringify(item)}});
    },
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.list-preview .list-form-pv .el-input {
  width: auto;
}

.breadcrumb-preview .el-breadcrumb ::v-deep .el-breadcrumb__separator {
  margin: 0 9px;
  color: #fff;
  font-weight: 500;
}

.breadcrumb-preview .el-breadcrumb ::v-deep .el-breadcrumb__inner a {
  color: #fff;
  display: inline-block;
}

.breadcrumb-preview .el-breadcrumb ::v-deep .el-breadcrumb__inner {
  color: #fff;
  display: inline-block;
}

.category-1 .item {
  cursor: pointer;
  padding: 0 10px;
  margin: 0 8px 0 0;
  color: #666;
  font-size: 16px;
  border-color: #ff9966;
  line-height: 50px;
  border-radius: 0;
  background: none;
  width: auto;
  border-width: 0 0 6px;
  border-style: inset;
  text-align: center;
  min-width: 80px;
  height: 58px;
}

.category-1 .item:hover {
  cursor: pointer;
  border-radius: 0;
  margin: 0 8px 0 0;
  color: #333;
  background: none;
  font-size: 16px;
  border-color: #1e8892;
  border-width: 0 0 6px;
  border-style: solid;
  text-align: center;
}

.category-1 .item.active {
  cursor: pointer;
  border-radius: 0;
  margin: 0 10px 0 0;
  color: #333;
  background: none;
  font-size: 16px;
  border-color: #1e8892;
  border-width: 0 0 6px;
  line-height: 50px;
  border-style: solid;
  text-align: center;
}

.category-2 .item {
  cursor: pointer;
  border-radius: 4px;
  margin: 0 0 10px 0;
  color: #999;
  background: #efefef;
  width: 100%;
  font-size: 14px;
  line-height: 36px;
  text-align: center;
}

.category-2 .item:hover {
  cursor: pointer;
  border-radius: 4px;
  margin: 0 0 10px 0;
  color: #999;
  background: #efefef;
  width: 100%;
  font-size: 14px;
  line-height: 36px;
  text-align: center;
}

.category-2 .item.active {
  cursor: pointer;
  border-radius: 4px;
  margin: 0 0 10px 0;
  color: #999;
  background: #efefef;
  width: 100%;
  font-size: 14px;
  line-height: 36px;
  text-align: center;
}

.list-form-pv .el-input ::v-deep .el-input__inner {
  border: 0;
  border-radius: 0;
  padding: 0 10px;
  box-shadow: 0px 4px 0px #ff9966;
  margin: 0;
  outline: none;
  color: #333;
  width: 140px;
  font-size: 16px;
  line-height: 42px;
  height: 42px;
}

.list-form-pv .el-select ::v-deep .el-input__inner {
  border: 0;
  border-radius: 0;
  padding: 0 10px;
  box-shadow: 0px 4px 0px #ff9966;
  margin: 0;
  outline: none;
  color: #333;
  width: 140px;
  font-size: 16px;
  line-height: 42px;
  height: 42px;
}

.list-form-pv .el-date-editor ::v-deep .el-input__inner {
  border: 0;
  border-radius: 0;
  padding: 0 30px;
  box-shadow: 0px 4px 0px #ff9966;
  margin: 0;
  outline: none;
  color: #333;
  width: 140px;
  font-size: 16px;
  line-height: 42px;
  height: 42px;
}

.list .index-pv1 .animation-box {
  transform: rotate(0deg) scale(1) skew(0deg, 0deg) translate3d(0px, 0px, 0px);
  z-index: initial;
}

.list .index-pv1 .animation-box:hover {
  transform: translate3d(0px, 0px, 0px);
  -webkit-perspective: 1000px;
  perspective: 1000px;
  transition: 0.3s;
  z-index: 1;
}

.list .index-pv1 .animation-box img {
  transform: rotate(0deg) scale(1) skew(0deg, 0deg) translate3d(0px, 0px, 0px);
}

.list .index-pv1 .animation-box img:hover {
  -webkit-perspective: 1000px;
  perspective: 1000px;
  transition: 0.3s;
}

.el-pagination ::v-deep .el-pagination__total {
  margin: 0 10px 0 0;
  color: #666;
  font-weight: 400;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  height: 28px;
}

.el-pagination ::v-deep .btn-prev {
  border: none;
  border-radius: 2px;
  padding: 0;
  margin: 0 5px;
  color: #666;
  background: #f4f4f5;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  min-width: 35px;
  height: 28px;
}

.el-pagination ::v-deep .btn-next {
  border: none;
  border-radius: 2px;
  padding: 0;
  margin: 0 5px;
  color: #666;
  background: #f4f4f5;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  min-width: 35px;
  height: 28px;
}

.el-pagination ::v-deep .btn-prev:disabled {
  border: none;
  cursor: not-allowed;
  border-radius: 2px;
  padding: 0;
  margin: 0 5px;
  color: #C0C4CC;
  background: #f4f4f5;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  height: 28px;
}

.el-pagination ::v-deep .btn-next:disabled {
  border: none;
  cursor: not-allowed;
  border-radius: 2px;
  padding: 0;
  margin: 0 5px;
  color: #C0C4CC;
  background: #f4f4f5;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  height: 28px;
}

.el-pagination ::v-deep .el-pager {
  padding: 0;
  margin: 0;
  display: inline-block;
  vertical-align: top;
}

.el-pagination ::v-deep .el-pager .number {
  cursor: pointer;
  padding: 0 4px;
  margin: 0 5px;
  color: #666;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  border-radius: 2px;
  background: #f4f4f5;
  text-align: center;
  min-width: 30px;
  height: 28px;
}

.el-pagination ::v-deep .el-pager .number:hover {
  cursor: pointer;
  padding: 0 4px;
  margin: 0 5px;
  color: #ff9966;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  border-radius: 2px;
  background: #f4f4f5;
  text-align: center;
  min-width: 30px;
  height: 28px;
}

.el-pagination ::v-deep .el-pager .number.active {
  cursor: default;
  padding: 0 4px;
  margin: 0 5px;
  color: #FFF;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  border-radius: 2px;
  background: #ff9966;
  text-align: center;
  min-width: 30px;
  height: 28px;
}

.el-pagination ::v-deep .el-pagination__sizes {
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  height: 28px;
}

.el-pagination ::v-deep .el-pagination__sizes .el-input {
  margin: 0 5px;
  width: 100px;
  position: relative;
}

.el-pagination ::v-deep .el-pagination__sizes .el-input .el-input__inner {
  border: 1px solid #DCDFE6;
  cursor: pointer;
  padding: 0 25px 0 8px;
  color: #606266;
  display: inline-block;
  font-size: 13px;
  line-height: 28px;
  border-radius: 3px;
  outline: 0;
  background: #FFF;
  width: 100%;
  text-align: center;
  height: 28px;
}

.el-pagination ::v-deep .el-pagination__sizes .el-input span.el-input__suffix {
  top: 0;
  position: absolute;
  right: 0;
  height: 100%;
}

.el-pagination ::v-deep .el-pagination__sizes .el-input .el-input__suffix .el-select__caret {
  cursor: pointer;
  color: #C0C4CC;
  width: 25px;
  font-size: 14px;
  line-height: 28px;
  text-align: center;
}

.el-pagination ::v-deep .el-pagination__jump {
  margin: 0 0 0 24px;
  color: #606266;
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  line-height: 28px;
  height: 28px;
}

.el-pagination ::v-deep .el-pagination__jump .el-input {
  border-radius: 3px;
  padding: 0 2px;
  margin: 0 2px;
  display: inline-block;
  width: 50px;
  font-size: 14px;
  line-height: 18px;
  position: relative;
  text-align: center;
  height: 28px;
}

.el-pagination ::v-deep .el-pagination__jump .el-input .el-input__inner {
  border: 1px solid #DCDFE6;
  cursor: pointer;
  padding: 0 3px;
  color: #606266;
  display: inline-block;
  font-size: 14px;
  line-height: 28px;
  border-radius: 3px;
  outline: 0;
  background: #FFF;
  width: 100%;
  text-align: center;
  height: 28px;
	}
</style>
